package ar.com.globallogic.promomr.domain;

import java.util.Date;

import ar.com.globallogic.promomr.exceptions.InvalidPublicationStateTransitionException;


public class UploadedState extends PublicationState {

	@Override
	public String getName() {
		return "UPLOADED";
	}

	@Override
	public void publish(Publication publication) {
		publication.setState(new PublishedState());
	}

	@Override
	public void publishAt(Publication publication, Date publicationDate) {
		publication.setState(new PendingState(publicationDate));
	}

	@Override
	public void cancel(Publication publication) {
		throw new InvalidPublicationStateTransitionException(publication.getId(), this.getName());
	}

}
